#ifndef TEXTITEM_H
#define TEXTITEM_H

#include <QGraphicsTextItem>
#include <QPen>

QT_BEGIN_NAMESPACE
class QFocusEvent;

class QGraphicsItem;

class QGraphicsScene;

class QGraphicsSceneMouseEvent;

QT_END_NAMESPACE

class TextItem
        : public QGraphicsTextItem
{
Q_OBJECT

public:
    enum
    {
        Type = QGraphicsItem::UserType + 5
    };

    TextItem(QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);

    int type() const
    { return Type; }

signals:

    void lostFocus(TextItem *item);

    void selectedChange(QGraphicsItem *item);

protected:
    QVariant itemChange(GraphicsItemChange change, const QVariant &value);

    void focusOutEvent(QFocusEvent *event);

    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);


};

#endif // TEXTITEM_H
